<template>
	<div class="webSocket">
		<el-card class="box-card">
			<div slot="header" class="clearfix">
				<span>webSocket</span>
			</div>
			<div class="center">
				<div class="item">
					<div class="h1">服务器：{{GLOBAL.formatDate(new Date())}}</div>
					<div class="text">Websocket连接已建立，正在等待数据...</div>
				</div>
			</div>
		</el-card>

	</div>
</template>

<script>
	let that = ''
	//非父子组件传值
	import bus from '../../../../static/js/bus.js';
	import {
		mapActions,
		mapGetters
	} from 'vuex';
	export default {
		computed: {
			...mapGetters(['userInfo', 'api']) //获取
		},
		components: {},
		data() {
			return {
				activeNames: ['1'],
				list:[],
			}
		},
		mounted() {
			that = this
			bus.$off('SocketTask_onmessage')
			bus.$on('SocketTask_onmessage', (data) => {
				//监听到websocket消息
				that.onMessenge(data)
			})
		},
		methods: {
			//监听到websocket消息
			onMessenge(data) {

			}

		}
	}
</script>

<style scoped="scoped" lang="scss">
	.webSocket {
		.center{
			.item{
				.h1{
					color: blue;font-size: 12px;
				}
			}
			
		}
	}
</style>
